Repository navigation
Conversation
435e6a8 to
f065ef1
Compare
yatesdr
left a comment
There was a problem hiding this comment.
This report would have flagged the stale pointer in #266, but as printed it is hard to act on and can show only noise. It needs these changes before it can merge.
Blocking
- It prints a handle, not a kernel.
capture.rs:3150printscandidate.function, the run-specificCUfunctionhandle. The symbol is resolved withcuFuncGetNamein the same scope (capture.rs:2961-2972). Print the symbol. - It prints once per rank. The block at
capture.rs:3137runs on every rank with no rank label, while progress output is rank-0 only (capture.rs:2774-2778). Print on rank 0, or label the rank. - The examples can all be noise. The ten examples are the first ten hits (
reachability.rs:176,take(remaining)), not representative ones as the doc comment says. #266's audit found W4A8 constants that also fall in recorded-envelope gaps; if they come first, they fill every slot. Keep one example per unique address and correct the comment. - Measure the noise. The description says noise on real exports is unmeasured. Run one W4A8 export and post the occurrence count and unique-address count.
- CONTRIBUTING.md requires
Signed-off-byon every commit; f065ef1 has none.
Should fix
- Tests:
unresolved_unique_addressesis checked with one address only, so deduplication is untested; the print block incapture.rshas no test;repeated_argument_bytes_report_every_call_site(reachability.rs:728) repeats whatunresolved_examples_are_capped_while_occurrences_are_counted(line 690) already proves, except the graph name. - The commit message and the PR description differ (formatting result, issue references). Keep one text.
f065ef1 to
499710e
Compare
yatesdr
left a comment
There was a problem hiding this comment.
Checked 499710e against the last round. The kernel symbol, the rank label, one example per address, the sign-off and the matching commit and PR text are fixed. On x86-64 Linux, CPU only, cargo test --manifest-path heliopause/Cargo.toml --lib passes at this head and with the head merged into main d8fd143 (206 passed, 4 ignored, both). We did not run clippy or an export.
One item from the last round is still open, and there are three new points:
- Noise on a real export (blocking, from the last round). No export has run. The examples are the first ten distinct addresses in graph and node order (
reachability.rs:174-180), so ten distinct numeric constants that come earlier fill every slot and the stale address shows up only in the hidden count. Please post the printed summary from one W4A8 export with this build: the occurrence and distinct-address counts on each rank, and any example that is not a W4A8 MoE constant. - The cuBLASLt example contradicts #266. The description and commit message say CUDA-library kernels such as cuBLASLt carry address-shaped numeric constants. In #266 the cuBLASLt split-K arguments (
nvjet_..._splitK_TNNN,cublasLt::splitKreduce_kernel) are the stale pointers, and the only other hits are constants in the W4A8 MoE kernels. Name the kernels that actually produce the false positives. - Inactive ranges. A value inside an inactive range (a free block of a live segment) is still dropped with no report, and #266 says a pointer into a free block is just as unsafe at replay. Report those values too, or state in the description why they are excluded, so that an export with no summary line is not read as free of unowned pointers.
- Bookkeeping (should-fix). Each candidate stores the
CUfunctionhandle, andkernel_symbols(capture.rs:2709-2719) rebuilds a handle-to-symbol map that depends on two lists sharing an order.Reachability::graphalready has the kernel's index intofunctions(node.function,reachability.rs:285, written atcapture.rs:889); storing that index removeskernel_symbols, its test and themodulecopies. The miss lists,unresolved_count, the example list withexample_addresses, andunresolved_unique_addresses(reachability.rs:84-86,:196) also track one fact; one map from address to its first site and occurrence count would replace them.
6869905 to
11f2c1c
Compare
11f2c1c to
c3cc87e
Compare
|
The proposed diagnostic now reports kernel-argument candidates in inactive parts of recorded allocation segments without retaining those allocations. The build-host Heliopause tests passed (205 passed, 4 ignored), including inactive-range boundaries and non-retention. Issue #266 identifies cuBLASLt split-K arguments as the stale-workspace-pointer case; the W4A8 MoE constants are a separate source of address-shaped numeric values. The updated PR description distinguishes them. An SM120 two-GPU export of the recipe-pinned
All ten printed examples per rank were from mHC Cutlass kernels, rather than W4A8 MoE kernels. These totals include the whole graph scan; they do not establish W4A8 MoE kernel behavior or whether the mHC values are constants or stale pointers. The run does not reproduce #266's four-GPU DeepSeek V4.1 failure. I have only three RTX PRO 6000 GPUs and cannot export |
yatesdr
left a comment
There was a problem hiding this comment.
Thanks for the export numbers; they answer the first item of the last round. At c3cc87e:
- inactive ranges are reported without being retained;
- one map now holds each address's first site and count;
- symbols come from the recorded function index;
- the description's account of #266 is fixed.
One change before this can merge, and three smaller ones:
-
Report only offsets that can hold a pointer (blocking).
scanstepsdata.windows(8)one byte at a time (reachability.rs:259), so the report records a value at every byte offset of an argument.- Argument bytes are encoded per parameter (
encode_kernel). CUDA places a pointer at an 8-byte-aligned offset within its parameter, so a value at offset 4 spans two fields and is not a pointer. Your first example is one: argument 0, offset 4,0x100000000800. - #266's stale arguments sit at offset 256 of a 384-byte parameter and at offset 0 of argument 1.
- With about 2,640 distinct candidates per rank, the ten printed examples fill with these windows before a stale pointer can appear.
Keep retention as it is, report only argument-relative offsets divisible by 8, and post the counts from the same export again. If thousands remain, one example per kernel symbol would show which kernels produce them.
-
One rule, one place.
candidatealready treats an inactive range as a hit, andscanrepeats the inactive lookup (in_free_block,reachability.rs:262-265) to report it. State that rule once. -
A test for item 1. Put an 8-byte pointer to a live allocation, then a small integer, in one argument. Assert that the window straddling them is not reported, and that a stale pointer at an aligned offset is.
-
Commit message.
- Its first paragraph says values "outside live recorded allocations", which no longer covers inactive ranges.
- The description reports an export with MXFP4/A8 experts, while the commit message still lists W4A8 as untested. Make the two agree.
|
A case file has been opened for 332. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review for Agents. Recommendation: Changes RequestedBlockers:
Should fix:
Nits:8 nits To opt out, include #autobot:ignore in your post or comment. |
c3cc87e to
1ac7073
Compare
|
Rebased onto
Aligned 2-GPU export rerunRe-ran the two-GPU SM120 export of
Verbatim stderr diagnostic output: On a Linux x86_64 host without CUDA against commit |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedCore implementation at
Have your agent review the Full Review for complete verified findings, To opt out, include |
Captured CUDA graph kernel arguments can retain stale workspace addresses that fall in gaps between live allocations or in inactive parts of recorded segments, as seen in cuBLASLt split-K arguments for issue NVIDIA#266. Before this change, export reachability discarded address-shaped kernel-argument values inside the recorded address envelope that resolved to no active allocation without reporting them. Untyped parameters such as W4A8 MoE kernel arguments can also hold address-shaped numeric constants, so failing an export on every unresolved value would reject valid models. Replace `Reachability::pointer` with `Reachability::candidate` as the single check for live storage versus inactive ranges and gaps in `heliopause/src/export/reachability.rs`, retaining only live allocations and returning `false` without retaining storage for both gaps and inactive ranges. Keep `Reachability::scan` stepping byte-by-byte for conservative retention while collecting unresolved candidates only at argument-relative offsets divisible by 8 (`(base + offset).is_multiple_of(8)`), filtering out 8-byte windows that straddle adjacent parameters. Extract `Reachability::record_unresolved` so `Reachability::blob` records unresolved sites without cloning cached miss vectors, and record each distinct unresolved address's first graph, node, recorded function index, parameter, byte offset, encounter order, and occurrence count. Update `Reachability::unresolved_report` to select up to ten distinct addresses, prioritizing one first-encountered address per distinct recorded kernel symbol before backfilling remaining slots in encounter order, with per-address occurrence counts and exact omitted distinct-address and occurrence counts. From `heliopause/src/export/capture.rs`, write `reach.unresolved_report(&output.index.ranks[0].functions)` directly to stderr per rank (returning an empty vector when no unresolved candidates exist). Keep declared numeric exclusions and allocation-content scanning unchanged, and document the stderr diagnostic in `docs/runtime-core-design.md` and pending multi-GPU measurements in `docs/TODO.txt`. Model export now surfaces 8-byte-aligned unresolved kernel-argument address candidates per rank as a non-blocking diagnostic without changing allocation retention, excludes 8-byte windows that straddle adjacent parameters, spreads up to ten printed examples across distinct kernel symbols before backfilling in encounter order, and reports exact per-address and omitted counts. On this commit's tree on Linux x86_64 without CUDA, `cargo test --locked --manifest-path heliopause/Cargo.toml --lib` completed (`exit 0`) with 231 passed, 0 failed, and 6 ignored (all 6 ignored tests require a CUDA device), including all 28 tests in `export::reachability::tests` covering aligned stale pointers versus straddling windows, argument-relative alignment after an unaligned numeric prefix, aligned and unaligned inactive-range boundaries without retaining inactive storage, per-symbol example prioritization and encounter-order backfill, omission of the trailing line at or below 10 distinct addresses, and exact omitted distinct-address and occurrence sums above 10. A prior two-GPU SM120 export of `local-inference-lab/DeepSeek-V4-Flash-Vision-Exp-lossless-CSF` (`45fd9976`, two RTX PRO 6000 Blackwell Max-Q GPUs, driver 615.71.09, PyTorch 2.14.1+cu132, FlashInfer 0.7.3 at `5d2a7107`, `hyperflare-recipes` at `d1376bb`, `--gpus 0,1 --max-concurrency 1 --image-concurrency 1 --no-mtp --prefill-chunk-size 4096 --autotune-effort off --compile-workers 4`) exercised the same `Reachability::scan` and `Reachability::candidate` alignment filtering prior to adding per-symbol example prioritization in `unresolved_report`, completing (`exit 0`) with 22,618 occurrences / 762 distinct aligned addresses on rank 0 and 19,417 occurrences / 832 distinct aligned addresses on rank 1. Per-symbol example selection in `unresolved_report` was added afterward and verified by CPU unit tests; the ten-line stderr sample has not been re-captured on GPU. Limitations: unaligned unresolved values (including non-8-byte-aligned struct fields), values outside the recorded address envelope, and stale values aliasing live storage are not reported; four-GPU DeepSeek V4.1 exports (NVIDIA#266) and eight-GPU W4A8 MoE exports remain unrun. Refs NVIDIA#266. Signed-off-by: Mark Yong <mark-yong@users.noreply.github.com> Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b
1ac7073 to
38805ba
Compare
|
@flare-autobot @yatesdr Rebased onto
Validation: Against commit |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeAll prior blockers from
Walkthrough
Merge Risk: Low · up to
|
Refs #266.
Request
A captured CUDA graph can retain a kernel argument pointer to a workspace allocation no longer owned by the exported model (for example, cuBLASLt split-K arguments identified in #266). Export reachability scanning previously discarded address-shaped kernel-argument values inside the recorded address envelope that resolved to no active allocation without reporting them. Untyped kernel parameters, such as W4A8 MoE arguments, can also hold address-shaped numeric constants, so failing an export on every unresolved value would reject valid models.
Change
heliopause/src/export/reachability.rsreplacesReachability::pointerwithReachability::candidateas the single rule for live allocations versus gaps and inactive ranges:candidateretains only live allocations and returnsfalsewithout retaining storage for both gaps and inactive ranges.Reachability::scankeeps stepping byte-by-byte for conservative retention, while unresolved candidate collection filters to argument-relative 8-byte-aligned offsets ((base + offset).is_multiple_of(8)) so 8-byte windows straddling adjacent parameters are not reported.Reachability::record_unresolveddeduplicates cache-hit and cache-miss recording soReachability::blobavoids cloning per-blob miss vectors.Reachability::graphsupplies each call site soReachability::unresolved_reportrecords each distinct address's first graph, node, recorded function index, parameter, byte offset, encounter order, and occurrence count, selecting up to ten examples per rank with one first-encountered address per distinct recorded kernel symbol before backfilling remaining slots in encounter order.From
heliopause/src/export/capture.rs, each rank writesreach.unresolved_report(&output.index.ranks[0].functions)directly to stderr (unresolved_reportreturns an empty vector when no unresolved candidates exist): a summary line stating that candidates resolve to no active recorded allocation (gap or inactive range), up to ten distinct addresses with per-address occurrence counts, and a trailing line giving the exact omitted distinct-address and occurrence counts when more than ten distinct addresses occur. Declared numeric exclusions and allocation-content scanning keep their existing behavior.docs/runtime-core-design.mddocuments the non-blocking per-rank stderr diagnostic, anddocs/TODO.txttracks the pending four-GPU DeepSeek V4.1 (#266) and eight-GPU W4A8 MoE export measurements.Model export now surfaces 8-byte-aligned unresolved kernel-argument address candidates per rank as a non-blocking diagnostic without changing allocation retention, excluding 8-byte windows that straddle adjacent parameters, spreading up to ten printed examples across distinct kernel symbols before backfilling in encounter order, and reporting exact per-address and omitted counts.
Validation
On a Linux x86_64 host without CUDA against commit
38805ba3,cargo test --locked --manifest-path heliopause/Cargo.toml --libcompleted (exit 0) with 231 passed, 0 failed, and 6 ignored (all 6 ignored tests require a CUDA device), including all 28 tests inexport::reachability::tests. Covered cases include aligned stale pointers versus straddling windows, argument-relative alignment after a four-byte numeric exclusion prefix, inactive-range boundaries at aligned and unaligned offsets without retaining inactive storage, first-site and recorded-symbol lookup, prioritization across distinct kernel symbols with encounter-order backfill, per-address occurrence counts, omission of the trailing line at or below 10 distinct addresses, and exact omitted distinct-address and occurrence sums above 10.Separately, an earlier two-GPU SM120 export of
local-inference-lab/DeepSeek-V4-Flash-Vision-Exp-lossless-CSF(45fd9976, two RTX PRO 6000 Blackwell Max-Q GPUs, driver615.71.09, PyTorch2.14.1+cu132, FlashInfer0.7.3at5d2a7107,hyperflare-recipesatd1376bb,--gpus 0,1 --max-concurrency 1 --image-concurrency 1 --no-mtp --prefill-chunk-size 4096 --autotune-effort off --compile-workers 4) exercised the identicalReachability::scanandReachability::candidatealignment filtering prior to adding per-symbol prioritization inunresolved_report, completing (exit 0) with 22,618 occurrences / 762 distinct aligned addresses on rank 0 and 19,417 occurrences / 832 distinct aligned addresses on rank 1. Per-symbol example selection inunresolved_reportwas verified afterward by the CPU unit suite.Limitations
Unaligned unresolved kernel-argument values (including non-8-byte-aligned struct fields), values outside the recorded address envelope, and stale values that alias live storage are not reported by this scan. The ten-line stderr sample with per-symbol example prioritization has not been re-captured on GPU, and four-GPU DeepSeek V4.1 (#266) and eight-GPU W4A8 MoE exports remain unrun on four-GPU and eight-GPU hardware.
Discord: myong_acct